package com.djc8.controller.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.djc8.entity.AdminBean;
import com.djc8.entity.UserInfoBean;

/**
 * Servlet implementation class AdminLoginExitServlet
 */
public class AdminLoginExitServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;


	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		if ((AdminBean) request.getSession().getAttribute("Admin_User") != null){
			request.getSession().removeAttribute("Admin_User");
		    request.getSession().removeAttribute("Admin_Name");
		}
		else{
			request.getSession().removeAttribute("Admin_User");
			request.getSession().removeAttribute("Admin_Name");
		}

	
		 response.sendRedirect("admin/AdminLogin.jsp");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
